//
//  DiscountCollectionViewCell.m
//  FairyDream
//
//  Created by dllo on 15/8/26.
//  Copyright (c) 2015年 dreams. All rights reserved.
//

#import "DiscountTableViewCell.h"
#import "UIImageView+WebCache.h"
@implementation DiscountTableViewCell

- (void)dealloc
{
    [_aImage release];
    [super dealloc];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.aImageArray = [NSMutableArray array];
        [self createImage];
    }
    return self;
}


- (void)createImage
{
    UILabel *lable = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, 100, 30)];
    lable.text = @"抢特价折扣";
    [self addSubview:lable];
    self.aImage = [[UIImageView alloc] initWithFrame:CGRectMake( 5, 50, self.frame.size.width + 45, 150)];
    [self addSubview:_aImage];
    
    [lable release];
    [_aImage release];
    [self setMessage];
}

- (void)setMessage
{
    NSDictionary *dic = [_aImageArray firstObject];
    [_aImage sd_setImageWithURL:[NSURL URLWithString:[dic objectForKey:@"photo"]] placeholderImage:nil];
}




@end
